package com.qianmang.damawangticket.utils;

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;

public class KeyBoardUtils {
    public static void hideKeyBoard(Context context, View view) {
        final Context applicationContext = context.getApplicationContext();
        InputMethodManager inputMethodManager = (InputMethodManager) applicationContext.getSystemService(Context.INPUT_METHOD_SERVICE);
        inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.RESULT_UNCHANGED_SHOWN);
    }

    public static void showKeyBoard(Context context, View view) {
        final Context applicationContext = context.getApplicationContext();
        InputMethodManager inputMethodManager = (InputMethodManager) applicationContext.getSystemService(Context.INPUT_METHOD_SERVICE);
        inputMethodManager.showSoftInput(view, InputMethodManager.RESULT_UNCHANGED_SHOWN);
    }
}
